{include file='ebcms@common/header' /}
<div class="container-fluid">
    <div class="row">
        <div class="col-md-12">
            <h3>
                <span>数据字典</span>
                <a href="{:url('datadictcate/add')}"><span class="glyphicon glyphicon-plus"></span></a>
            </h3>
            <div class="table-responsive">
                <table class="table table-bordered table-hover table-ebcms">
                    <tbody>
                        <tr>
                            <th style="width:80px;">排序</th>
                            <th style="width:90px;">操作</th>
                            <th>名称</th>
                            <th>字段</th>
                            <th style="width:100px;">应用</th>
                            <th style="width:50px;">管理</th>
                        </tr>
                        {php}
                            $data = \app\ebcms\model\Datadictcate::order('sort desc,id asc') -> select();
                            $data = \ebcms\Tree::group($data);
                        {/php}
                        {foreach name='data' item='items' key='group'}
                            <tr>
                                <th>{$group}</th>
                                <th colspan="5">
                                    <a href="{:url('datadictcate/add?group='.$group)}" class="btn btn-primary">添加</a>
                                </th>
                            </tr>
                            {foreach name='items' item='vo'}
                                <tr>
                                    <td>
                                        <input value="{$vo.sort}" class="form-control input-sm ebcms-change" url="{:url('datadictcate/resort')}" data-id="{$vo.id}">
                                    </td>
                                    <td>
                                        <button type="button" class="btn btn-primary btn-sm ebcms-do" url="{:url('datadictcate/delete')}" data-ids='{$vo.id}' confirm="删除后不可恢复，确定删除？"><span class="glyphicon glyphicon-remove"></span></button>
                                        <a href="{:url('datadictcate/edit?id='.$vo['id'])}" class="btn btn-primary btn-sm"><span class="glyphicon glyphicon-pencil"></span></a>
                                    </td>
                                    <td>{$vo.title}</td>
                                    <td>{$vo.field}</td>
                                    <td>{$vo.app}</td>
                                    <td>
                                        <a href="{:url('index?id='.$vo['id'])}" target="right" class="btn btn-primary btn-sm">管理</a>
                                    </td>
                                </tr>
                            {/foreach}
                        {/foreach}
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
{include file='ebcms@common/footer' /}